<%@page import="java.util.UUID"%>
<%@include file="common/common.jsp" %>
<%
String rkey = (request.getParameter("key"));
String rtype = request.getParameter("type");
String rhkey = (request.getParameter("hkey"));
String rindex = request.getParameter("index");
String rvalue = (request.getParameter("value"));
if(rkey != null) {
	if("hash".equals(rtype) && rhkey != null) {
		jedis.hdel(rkey, rhkey);
	} else if("list".equals(rtype) && rindex != null) {
		String uuid = UUID.randomUUID().toString();
		jedis.lset(rkey, Long.parseLong(rindex), uuid);
		jedis.lrem(rkey, Long.parseLong(rindex), uuid);
	} else if("set".equals(rtype) && rvalue != null) {
		jedis.srem(rkey, rvalue);
	} else if("zset".equals(rtype) && rvalue != null) {
		jedis.zrem(rkey, rvalue);
	} else {
		jedis.del(rkey);
	}
}
out.print("?s=" + selectServer);
%>